//
//  MainViewModel.swift
//  GitTFGUI
//
//  Created by Samuel Richard Magny on 2015-09-26.
//  Copyright © 2015 Samuel Richard Magny. All rights reserved.
//

import Cocoa
import TFSClient
import SwiftTools

class MainViewModel: NSObject {

    private let _tfsClient: ExtendedTFSClient
    
    required init(tfsClient:ExtendedTFSClient) {
        self._tfsClient = tfsClient
    }
    
    var workingDirectory:String {
        get {
            return _tfsClient.workingDirectory
        }
        set(value) {
            _tfsClient.workingDirectory = value
        }
    }
    
    func retreivePendingChangeFiles(completionHandler:(OrderedDictionary<String, TFSFile>)->())
    {
        _tfsClient.retreivePendingChangeFiles(completionHandler)
    }
    
    func stageFile(file:TFSFile) -> TFSFile
    {
        return _tfsClient.stageFile(file)
    }
    
    func unStageFile(file:TFSFile) -> TFSFile
    {
        return _tfsClient.unStageFile(file)
    }
    
    func areCredentialsValids() -> Bool
    {
        return _tfsClient.areUsernameAndPasswordValids()
    }
    
}
